<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="./037消息订阅与发布.js"></script>
    <script>
        PubSub.subscribe('pay',data=>{
            console.log('商家接到了订单，准备开始制作',data);
        })

        PubSub.subscribe('pay',data=>{
            console.log('骑手接到了订单，准备开始去取餐',data);
        })

        PubSub.publish('pay',{
            title:'牛肉面',
            price:20,
            pos:'三年二班'
        })
    </script>
</body>
</html>